const path = require('path');
const express = require('express');
const swaggerUI = require('swagger-ui-express');
const swaggerJsdoc = require('swagger-jsdoc');

const options = {
  definition: {
    openapi: '3.1.0',
    info: {
      title: 'My API Documentation',
      version: '1.0.0',
      description: 'A sample API documentation using Swagger',
    },
    servers: [
      {
        url: 'http://localhost:3000', // 你的API地址
      },
    ],
  },
  apis: ['./src/share/apiDoc/*'], // 指定包含路由的文件位置
};

const swaggerSpec = swaggerJsdoc(options);

export default swaggerSpec;
